﻿<UserControl
 x:Class="WPFExcelReport.EDITAPZUORD"
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
 xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
 >
    <UserControl.Resources> 
        <CollectionViewSource  x:Key="vwAPZUORD" Source="{Binding Path=SetMaster.APZUORD}" />
        <CollectionViewSource  x:Key="vwAPKOPF" Source="{Binding Path=SetEnv.APZUORD}" />
        
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="1*" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <WrapPanel Grid.Row="0">
            <StackPanel>
                <Button  Height="30"  Width="30" Margin="10,0,0,0"   IsEnabled="True" Click="btnAddAPZ_Click">
                    <Button.Background>
                        <ImageBrush ImageSource="/IntexReportClient;component/Images/Add.png" />
                    </Button.Background>
                </Button>
                <TextBlock Text="{Binding Source={Localization:Translate Word=增加}}"></TextBlock>
            </StackPanel>
            <!--StackPanel Visibility="Hidden">
                        <Button  Height="30"  Width="30" Margin="10,0,0,0"   IsEnabled="True" Click="btnSaveAPZ_Click">
                            <Button.Background>
                                <ImageBrush ImageSource="Image/Save.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=保存}}"></TextBlock>
                    </StackPanel-->
        </WrapPanel>
        <StackPanel Grid.Row="1">
            <DataGrid  AutoGenerateColumns="False" EnableRowVirtualization="False" 
                       ItemsSource="{Binding Source={StaticResource ResourceKey=vwAPZUORD}}"
                       HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True"  
                       RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto" Height="Auto" EnableColumnVirtualization="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=APZART}" Header="物料" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=APZVAR}" Header="版本" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=APZANRKRS}" Header=" " Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=APZALFDNR}" Header="流程" Width="Auto" MinWidth="30" />
                </DataGrid.Columns>
            </DataGrid>
            <DataGrid Grid.Column="0" AutoGenerateColumns="False" EnableRowVirtualization="False"   HeadersVisibility="Column"
                      ItemsSource="{Binding Source={StaticResource ResourceKey=vwAPKOPF}}"
                              Name="dlgAPK"
                           CanUserResizeRows="True" CanUserSortColumns="True" 
                       Width="Auto" Height="Auto" EnableColumnVirtualization="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=APKANRKRS}" Header=" " Width="Auto" MinWidth="160" />
                    <DataGridTextColumn Binding="{Binding Path=APKALFDNR}" Header="流程" Width="Auto" MinWidth="40" />
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>
    </Grid>
</UserControl>
